import Mock from 'mockjs';

// 登录 post API
Mock.mock('/api/login','post',(options)=>{
    let {username,password}=JSON.parse(options.body);
    
    if(username==='admin' && password==="123"){
        return {
            code:0,
            message:"登陆成功",
            token:"admin"+new Date().getTime()
        }
    }else{
        return {
            code :1,
            message:"用户名或密码错误",
            token:""
        }
    }
 })
 